﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12._4
{
    internal class Program
    {
        static void Main(string[] args)
        {

            Farm<Animal> farm= new Farm<Animal>();
            farm.Animals.Add(new Cow("cow1"));
            farm.Animals.Add(new Chicken("chicken1"));
            farm.Animals.Add(new Cow("cow2"));
            farm.Animals.Add(new SuperCow("supercow1"));
            farm.Animals.Add(new Chicken("chicken2"));
            farm.Animals.Add(new SuperCow("supercow2"));
            farm.Animals.Add(new Cow("cow3"));
            farm.Animals.Add(new Cow("cow4"));

            farm.MakeNoisee();

            Farm<Cow> CowInFarm= farm.GetCows();

            CowInFarm.FeedTheAnimals();

            foreach (Cow cow in CowInFarm)
            {
                if (cow is SuperCow) {
                    (cow as SuperCow).Fly();
                }

            }
            Console.ReadLine();

        }
    }
}
